#!/bin/bash

CUR_PWD=$PWD"/"
echo "================================================"
echo "在一个路径下所有匹配文件名并获得绝对路径"

test_dir=$0_test_dir/a/b/c/d/e/
mkdir -p $test_dir
cd $test_dir
touch abcdefg.txt
touch abc1234.txt
echo $test_dir`ls | grep "abc*"`


echo "================================================"
echo "从一个路径下拷贝所有文件或文件夹到另一个路径"
cd $CUR_PWD

src_dir=$CUR_PWD"test_dir/src/"
dest_dir=$CUR_PWD"test_dir/dest/"
mkdir -p $src_dir/a/b/c
mkdir -p $src_dir/2
touch $src_dir/a.txt
touch $src_dir/1.txt
mkdir -p $dest_dir

#cp -r $src_dir/* $dest_dir
echo $CUR_PWD
echo $src_dir
echo $dest_dir

for file in `ls $src_dir`
do
	echo $file
	if [ $file != "2" ];then
		cp -r $src_dir$file $dest_dir
	else
		echo "dir 2 donot copy"
	fi
done
